package com.example.mybiadushoujiweishi.activity.acivitys;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RelativeLayout;


import com.example.mybiadushoujiweishi.R;
import com.example.mybiadushoujiweishi.activity.acivitys.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class WelcomeActivity extends BaseActivity {
    @BindView(R.id.activity_welcome)
    RelativeLayout activityWelcome;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.activity_welcome);
        ButterKnife.bind(this);
        ObjectAnimator animator = ObjectAnimator.ofFloat(activityWelcome, "alpha", 1.0f, 0.0f);
        animator.setDuration(3000);
        animator.start();
        animator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);

                startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
                finish();
                overridePendingTransition(R.anim.in_to_right,R.anim.trans_span);
            }
        });


    }


    @Override
    public int getContentView() {
        return R.layout.activity_welcome;
    }

    @Override
    public void initData() {

    }
}
